<include file="public@header"/>
<!-- <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/house.css" rel="stylesheet"> -->
</head>
<body>
  <div class="house-parameter-edit">
    <form action="addForm.html" class="js-ajax-form" method="post" name="addForm">
      <table class="table table-hover table-bordered">
        <tr>
          <td>奖品图片</td>
          <td>
            <div style="text-align: center;">
                <input type="hidden" name="picture" id="thumbnail" value="">
                <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                    <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                         id="thumbnail-preview"
                         width="135" style="cursor: pointer"/>
                </a>
                <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
            </div>
          </td>
        </tr>
        <tr>
          <td>奖品名称</td>
          <td><input class="form-control" type="text" name="name" value=""></td>
        </tr>
        <tr>
          <td>所需积分</td>
          <td><input class="form-control" type="text" name="score" value=""></td>
        </tr>
      </table>
      <!-- <input type="submit" class="btn btn-primary js-ajax-submit" name="submit" value="添加"> -->
    </form>
  </div>

  <script type="text/javascript">
    function getForm() {
      var formData = {
        picture: addForm.picture.value,
        score: addForm.score.value,
        name: addForm.name.value
      }

      var url = '{:url("addForm")}'
      return {
        url: url,
        formData: formData
      }
    }
    $(function () {
        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });
    });
  </script>
  <script src="__STATIC__/js/admin.js"></script>
</body>
</html>
